Skip to content

fix(e2e): Stop relying on startVerification to reset fva in reverification tests - #9291

Merged
wobsoriano merged 3 commits into
mainfrom
rob/fix-reverification-test
Jul 30, 2026
Merged

fix(e2e): Stop relying on startVerification to reset fva in reverification tests#9291
wobsoriano merged 3 commits into
mainfrom
rob/fix-reverification-test

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

Starting a session verification no longer resets the session's fva (recent server-side hardening), so the // Hack to reset fva in the Action reverification tests stopped working and both tests fail deterministically.

This PR replaces the hack with polling a fresh token until fva ages past the action's afterMinutes: 1 threshold.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c58c751

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Jul 30, 2026 7:46pm
swingset Ready Ready Preview Jul 30, 2026 7:46pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9291

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9291

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9291

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9291

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9291

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9291

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9291

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9291

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9291

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9291

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9291

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9291

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9291

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9291

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9291

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9291

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9291

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9291

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9291

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9291

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9291

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9291

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9291

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9291

commit: c58c751

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e671697-6dc4-43c2-8c95-78865b1c53d5

📥 Commits

Reviewing files that changed from the base of the PR and between cc47362 and c58c751.

📒 Files selected for processing (1)
  • integration/tests/reverification.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)
  • clerk/cli (auto-detected)

📝 Walkthrough

Walkthrough

Updated reverification error and recovery tests to poll uncached session tokens, decode the JWT payload, and wait until the first factor-age value reaches the required threshold. Removed the previous startVerification-based reset logic. Increased the recovery test timeout to 270,000 milliseconds.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: reverification tests no longer rely on startVerification to reset fva.
Description check ✅ Passed The description matches the changeset and explains the test update and the fva polling workaround.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integration/tests/reverification.test.ts`:
- Around line 243-244: Update both JWT polling blocks in the reverification test
to decode the payload segment as base64url by converting URL-safe characters and
adding required padding before parsing. Catch decoding or JSON parse failures
and return false so waitForFunction continues polling, while preserving the
existing fva array and threshold checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2334be56-abee-4ff3-ac3c-73f844125494

📥 Commits

Reviewing files that changed from the base of the PR and between 850051d and cc47362.

📒 Files selected for processing (1)
  • integration/tests/reverification.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)
  • clerk/cli (auto-detected)

Comment thread integration/tests/reverification.test.ts Outdated
@wobsoriano
wobsoriano merged commit a89ded1 into main Jul 30, 2026
50 checks passed
@wobsoriano
wobsoriano deleted the rob/fix-reverification-test branch July 30, 2026 19:56
wobsoriano added a commit that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants